﻿from django.conf.urls.defaults import *
#from django.contrib.auth.views import login, logout
from django.contrib import admin
from django.conf import settings


admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/(.*)', admin.site.root),
    #
    (r'^shm/', include('ktit.shm.urls')),
    (r'^task/', include('ktit.task.urls')),
    (r'^expdev/', include('ktit.expdev.urls')),
    (r'^storage/', include('ktit.sklad.urls')),
    (r'^profile/', include('userprofile.urls')),
    #
    (r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login/login.html'}),
    (r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'login/logout.html'}),   
    #
    (r'^test/', include('index.urls')),
    (r'^$', 'index.views.index'),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'D:/srv/www/django/ktit/media'}),
        (r'addressbook/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'D:/srv/www/django/ktit/addressbook'}),
    )
